<?php
/************************FoxPHP威客系统************************/
/*                                                            */
/*  FoxPHP.Com (C)2006-2016 FoxPHP Inc.                       */
/*  This is NOT a freeware, use is subject to license terms   */
/*  FoxPHP威客系统是商业软件,使用于商业用途请购买授权         */
/*  V3.0 2016.3                                               */
/*  foxphp@aliyun.com                                         */
/*  http://www.foxphp.com                                     */
/*                                                            */
/**************************************************************/

namespace Post\Controller;
$_POST['datatype']='json';
class ConsumeController extends \Member\Controller\IndexController {
	
	public function payinAction(){
		
		if(intval($_GET['mobile'])){
			//移动
		}else{
			//模块
			$model=new \Consume\Model\ConsumeModel();
			$url=$model->Payin();
			if($url==false){
				$this->error($model->getError(),'/member/payin/list');
			}else{
				$this->assign('url',$url);
				if($_POST['type']==1 || $_GET['type']=='alipay'){
					$this->display('Pay/Alipay/send');	
				}
			}
		}
	}
	
	public function payoutAction(){
		
		if(intval($_GET['mobile'])){
			//移动
		}else{
			//模块
			$model=new \Consume\Model\ConsumeModel();
			$id=$model->Payout();
			if(!empty($id)){
				$this->ajaxReturn(array('title'=>'提现操作','message'=>'操作成功!','status'=>'ok','refresh'=>true));
			}else{
				$this->ajaxReturn(array('title'=>'操作失败','message'=>$model->getError(),'status'=>'error','refresh'=>false,'callback'=>$model->Callback()));
			}
		}
	}
}